<?php
class CUrlHandle {

    public static function callUrl($url, $post_data = array()) {
        $handle = curl_init();

        curl_setopt($handle, CURLOPT_URL, $url);
        //curl_setopt($handle, CURLOPT_HEADER, $headers);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($handle, CURLOPT_POST, $post_data);

        $response = curl_exec($handle);
        $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);
        curl_close($handle);

        return json_decode($response);
    }

}